import Common from '../../common/common.js';
import GroupListItem from './GroupListItem.js';
import BaseList from '../base/BaseList.js';
import TimNet from '../../timnet.js';

//寄生组合式继承
function GroupList () {
    BaseList.call(this);
}
let prototype = Object.create(BaseList.prototype);
prototype.constructor = GroupList;
GroupList.prototype  = prototype;

//初始化数组数据
GroupList.prototype.initData = function(){
     TimNet.getGroupList(items=>{
        this.updateData(items)
    });
}


GroupList.prototype.updateData = function(items){
    this.setItems(items.map(t=>new GroupListItem(t)))
}

export default GroupList;
